<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        // test  测试   字符串是否满足这个正则   返回布尔值
        // exec  找到满足条件的字符串    返回的是数组

        let reg = /good/ ;
        let str = 'good nice';
        console.log(reg.test(str));

        console.log(reg.exec(str));

    </script>
    
</body>
</html>